beginoutdoorscript;

variables;

body;

beginstate 0; //INIT_STATE
break;

beginstate 1; //EXIT_STATE
break;

beginstate 2; //START_STATE
break;

beginstate 10; //farms
	if(get_flag(51,0) == 1)
		end();
	reset_dialog();
	add_dialog_str(0,"A few farmhouses are scattered around this clearing, surrounded by healthy-looking crops.",0);
	add_dialog_str(1,"You stop for a while to talk with the farmers, but don't learn anything relevant to your quest. Thankfully, the Loyalists haven't gotten this close to Stonesthrow.",0);
	run_dialog(1);
	set_flag(51,0,1);
break;

beginstate 15; //watchtower
	if(get_flag(51,1) == 1)
		end();
	reset_dialog();
	add_dialog_str(0,"A tall wooden watchtower watches over this island, with a few guards at the top staring out to the east.",0);
	add_dialog_str(1,"Normally, you'd question the utility of a watchtower out on a random island, but the possibility of Loyalist threats has you rethinking the Empire's almost insane obsession with posting guards everywhere.",0);
	run_dialog(1);
	set_flag(51,1,1);
break;

beginstate 20; //crazy hermit
	if(get_flag(51,2) == 1) {
		message_dialog("You don't feel like bothering the crazy hermit again, so you keep a safe distance from the ramshackle hut.","");
		end();
		}
	reset_dialog();
	if(in_boat() != -1)
		add_dialog_str(0,"You make your way along the shore of this small island, and find an isolated hut.",0);
	else
		add_dialog_str(0,"You guide your rickety boat up to the shore of this small island, and find an isolated hut.",0);
	add_dialog_str(1,"When you approach the run-down building, a crazed-looking man bursts out and nearly knocks you over. He starts ranting and raving about demons or something, frequently stopping to point to the south.",0);
	add_dialog_str(2,"Before he disappears into the hut again, he calls you several uncalled-for names and hurls a brass key at you.",0);
	add_dialog_str(3,"What an eccentric performance.",0);
	run_dialog(1);
	reward_give(445);
	set_flag(51,2,1);
break;

beginstate 25; //sand runes
	if(get_flag(51,3) == 1)
		end();
	if(has_item(445) == 0)
		end();
	
	reset_dialog();
	add_dialog_str(0,"The key you got from the crazy hermit starts vibrating in your pack, and you feel disoriented for a moment. Fortunately, the feeling passes.",0);
	run_dialog(1);
	change_char_xp(0,-100);
	change_char_xp(1,-100);
	change_char_xp(2,-100);
	change_char_xp(3,-100);

	set_flag(51,3,1);
break;